<?php

class Logout extends Controller{
	function Logout(){
		parent::Controller();
		$this->load->helper('url');
		$this->load->library('session');
	}
	
	function index(){
		$this->load->library('login_lib');
		$this->login_lib->logout();
		if( ($login_url = $this->session->userdata('login_url')) ){
			$this->session->unset_userdata('login_url');
			redirect($login_url);
		}else{
			redirect(CMF_LOGIN_URL);
		}
	}
}

?>